import { createApp } from 'vue'
import App from './App.vue'

import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import GlobalPlugin from '@/plugins/global-plugin'
import SvgIcon from '@/components/svg-icon/SvgIcon'

const app = createApp(App)
  .use(store) // 注入 vuex
  .use(router) // 注入 vue-router
  .use(ElementPlus) // 使用 element-ui
  .use(GlobalPlugin) // 引入全局变量
  .component('svg-icon', SvgIcon)

for (const [ key, component ] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')
